package com.niiwoo.activity.event.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Description 充值类型（普通充值代扣充值）
 * @Author zq
 * @Date 2018/3/21
 */
@Getter
@AllArgsConstructor
public enum RechargeTypeEventEnum {

    general(Byte.valueOf("1"), "普通充值"),
    withhold(Byte.valueOf("2"), "代扣充值");

    private Byte type;

    private String desc;

    public static RechargeTypeEventEnum valueOf(Byte code) {
        for (RechargeTypeEventEnum typeEventEnum : RechargeTypeEventEnum.values()) {
            if (code.byteValue() == typeEventEnum.getType()) {
                return typeEventEnum;
            }
        }
        return null;
    }
}
